package org.micode.common.exception;

import org.micode.common.enums.ResultEnum;

public class BaseException extends RuntimeException {

    private Integer code;

    public BaseException() {
    }

    public BaseException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public BaseException(ResultEnum resultEnum) {
        super(resultEnum.getName());
        this.code = resultEnum.getCode();
    }

    public BaseException(Integer code, String message, Throwable throwable) {
        super(message, throwable);
        this.code = code;
    }

    public Integer getCode() {
        return this.code;
    }
}

